<?php if(!defined('HDPHP_PATH'))exit;C('SHOW_NOTICE',FALSE);?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
    <title>编辑品牌</title>
    <link rel="stylesheet" type="text/css" href="http://localhost/my/wasai/Static/hdjs/hdjs.css">
    <script src="http://localhost/my/wasai/Static/Js/jquery-1.7.2.min.js" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript">
     	$(function(){
     		//删除图片
     		$('.del-img').click(function(){
     			$(this).parents('td').html('<input type="file" name="logo" id="" />');
     		})
     	})
     </script>
</head>
<body>
<div class="wrap">
    <div class="hd-title-header">编辑品牌</div>
    <form action="" method="post" class="form-inline hd-form" enctype="multipart/form-data">
        <table class="hd-table hd-table-list">
          <?php foreach ($oldData as $k=>$v){?>
            <tr>
                <th class="w100">品牌名称</th>
                <td  class="w100">
                    <input type="text" name="bname" class="w200" value="<?php echo $v['bname'];?>"/> 
                    <input type="hidden" name="bid" id="" value="<?php echo $v['bid'];?>" />
                </td>
                <td>品牌名称长度 1 到 20 位</td>
            </tr>
            
            <tr>
                <th class="w100">排序</th>
                <td>
                    <input type="text" name="sort" class="w200" value="<?php echo $v['sort'];?>"/>
                </td>
                <td> 请填写1到65535的排序数字</td>
            </tr>
            
            <tr>
                <th class="w100">品牌Logo</th>
                <td>
					    <?php if($v['logo']){ ?>
					    <input type="hidden" name="logo" value="<?php echo $v['logo'];?>"/>
                		<img src="http://localhost/my/wasai/<?php echo $v['logo'];?>" style="width: 80px;height: 34px;"/>	
                		<a href="javascript:;" style="color: red;" class="del-img">X</a>
					<?php }else{ ?>
					    <input type="file" name="logo" id=""/> 
					<?php } ?> 
                </td>
                <td></td>
            </tr>
            <?php }?>       
        </table>
        <div class="position-bottom">
            <input type="submit" class="hd-btn hd-btn-success" value="编辑"/>
        </div>
    </form>
</div>
</body>
</html>